package flater.cairngormtips.controller.delegates
{

import com.universalmind.cairngorm.business.Delegate;

import mx.rpc.Fault;
import mx.rpc.IResponder;
import mx.rpc.events.FaultEvent;

/**
 *  A delegate for performing the AnnounceFaultEvent operation. <code>exampleOperation</code>
 *  simply invokes the fault method of the responder, passing a FaultEvent.<br/>
 *  <br/>                                                                                            
 *  Author: <a href="http://www.adamflater.net" target="_blank">Adam Flater</a>
 *  <br/>
 *                                                                                           
 *  @see flater.cairngormtips.controller.commands.AnnounceFaultEventExampleCommand
 */ 
public class AnnounceFaultEventExampleDelegate extends Delegate
{
	public function AnnounceFaultEventExampleDelegate( commandHandlers : IResponder )
	{
		super( commandHandlers );
	}
	
	public function exampleOperation() : void
    {
        //--------------------------------------
    	// Mock a fault response
        //--------------------------------------
        
    	var fault : Fault = new Fault( "someFault", "An error has occurred." );
    	this.responder.fault( new FaultEvent( FaultEvent.FAULT, false, true, fault ) );
    }	


} //  end class
} //  end package